# class Solution:
#     def dicesProbability(self, n: int):
#         def find(target,total,c):
#             if total==target and c==n:
#                 return 1
#             elif target-total>=n-c:
#                 t=0
#                 for j in range(1,7):
#                     if total+j>target:
#                         break
#                     t+=find(target,total+j,c+1)
#                 return t 
#             else:
#                 return 0
#         result=[]
#         base=1/(6**n)
#         for i in range(n,n*6+1):
#             result.append(base*find(i,0,0))
#         return result
'''
超时
'''

class Solution:
    def dicesProbability(self, n: int):
        now=[1/6]*6
        for i in range(2,n+1):
            last=now
            now=[0]*(len(last)+5)
            for j in range(len(last)):
                for k in range(6):
                    now[j+k]+=1/6 * last[j]
        return now

s=Solution()
print(s.dicesProbability(2))

# 执行用时：
# 36 ms
# , 在所有 Python3 提交中击败了
# 86.54%
# 的用户
# 内存消耗：
# 14.8 MB
# , 在所有 Python3 提交中击败了
# 67.44%
# 的用户
